<el-form ref="editForm" :model="form" label-width="100px" label-position="left">
    <!-- 实体商品 -->
    <div v-if="productType==1">
        <el-form-item label="配送方式" prop="isStoreDelivery" :rules="{ required: true, message: '请选择配送方式'}">
            <el-checkbox v-model="form.isStoreDelivery" :true-label="1" :false-label="0">商家配送</el-checkbox>
            <el-checkbox v-model="form.isSelfDelivery" :true-label="1" :false-label="0">到店自提</el-checkbox>
        </el-form-item>
        <el-form-item label="运费模版" prop="freightTemplateId" v-if="form.isStoreDelivery==1"
            :rules="[{trigger: ['blur', 'change'] ,validator:validator}]" required>
            <el-select placeholder="请选择..." v-model="form.freightTemplateId" clearable>
                <el-option v-for="item in templateOptions" :key="item.id" :label="item.name" :value="item.id">
                </el-option>
            </el-select>
            <el-button style="margin-left:20px;" type="text" @click="addTemplate()">新增</el-button>
            <!-- <el-button type="text" @click="addTemplate()">管理</el-button> -->
            <el-button type="text" v-if="form.freightTemplateId && tableShow" @click="tableShow=false">收起</el-button>
            <el-button type="text" v-if="form.freightTemplateId && !tableShow" @click="tableShow=true">展开</el-button>
            <!-- <el-button type="text" @click="getTemplate()">刷新</el-button> -->
        </el-form-item>
    
    
        <el-form-item v-if="form.freightTemplateId && tableShow">
            <div v-for="(item,index) in templateOptions" v-if="item.id==form.freightTemplateId">
                <el-table :data="item.templateDetailLst" border style="width: 100%" size="mini">
                    <el-table-column prop="areaName" label="配送区域"></el-table-column>
                    <el-table-column align="center" width="140px" v-if="item.calculateType==1" prop="baseUnit"
                        label="首件（个）"> </el-table-column>
                    <el-table-column align="center" width="140px" v-if="item.calculateType==2" prop="baseUnit"
                        label="首重（kg）"> </el-table-column>
                    <el-table-column align="center" width="140px" v-if="item.calculateType==3" prop="baseUnit"
                        label="首体积（m³）"> </el-table-column>
                    <el-table-column align="center" width="140px" prop="baseAmount" label="运费（元）"> </el-table-column>
                    <el-table-column align="center" width="140px" v-if="item.calculateType==1" prop="extendAmount"
                        label="续件（个）"> </el-table-column>
                    <el-table-column align="center" width="140px" v-if="item.calculateType==2" prop="extendAmount"
                        label="续重（kg）"> </el-table-column>
                    <el-table-column align="center" width="140px" v-if="item.calculateType==3" prop="extendAmount"
                        label="续体积（m³）"> </el-table-column>
                    <el-table-column align="center" width="140px" prop="extendUnit" label="续费（元）"></el-table-column>
    
                </el-table>
            </div>
        </el-form-item>
    </div>
    <!-- 虚拟商品 -->
    <div v-if="productType==2">
        <el-form-item label="配送方式" >
            <div>无需配送</div>
            <div style="font-size: 12px; color:#999;">请在商品详情中说明商品的交付方式；如需买家下单时提交自定义信息，可在【通用设置】-【订单自定义字段】中设置</div>
        </el-form-item>
    </div>
</el-form>